Closed
Bug 1301639
Opened 9 years ago
Closed 9 years ago
[CID 1368390] Unit issue in ADTSDemuxer
Categories
(Core :: Audio/Video: Playback, defect)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: paul.bignier, Assigned: paul.bignier)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1368390)
Attachments
(1 file, 2 obsolete files)
1.13 KB,
patch
|
jya
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160803113201
Assignee | ||
Comment 1•9 years ago
|
||
* integer mult + div -> integer result. USECS_PER_S ensures that the result isn't decimal (at least negligible)
* 'usPerFrame' is converted back to uint64_t by FromMicroseconds() anyway
* CID 1368390
Attachment #8789743 -
Flags: review?(jyavenard)
Assignee | ||
Updated•9 years ago
|
Attachment #8789743 -
Attachment is obsolete: true
Attachment #8789743 -
Flags: review?(jyavenard)
Assignee | ||
Comment 2•9 years ago
|
||
* integer mult + div -> integer result. USECS_PER_S ensures that the result isn't decimal (at least negligible)
* 'usPerFrame' is converted back to uint64_t by FromMicroseconds() anyway
* CID 1368390
Attachment #8789752 -
Flags: review?(jyavenard)
Comment 3•9 years ago
|
||
Comment on attachment 8789752 [details] [diff] [review]
fixed - Fix a unit issue in ADTSDemuxer. r="jyavenard"
Review of attachment 8789752 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/ADTSDemuxer.cpp
@@ +613,5 @@
> if (!mSamplesPerSecond) {
> return media::TimeUnit::FromMicroseconds(-1);
> }
>
> + const uint32_t usPerFrame = USECS_PER_S * mSamplesPerFrame / mSamplesPerSecond;
this is too inaccurate.
you're now rounding before the final result
keep it a double, just cast USECS_PER_S to double.
Attachment #8789752 -
Flags: review?(jyavenard) → review-
Comment 4•9 years ago
|
||
if you do believe that using integer is fine.
Then use TimeUnit all the way and FramesToTimeUnit utility from VideoUtils.h
e.g.
TimeUnit frameDuration = FramesToTimeUnit(mSamplesPerFrame, mSamplesPerSecond);
return frameDuration * aNumFrames;
Actually,
return FramesToTimeUnit(aNumFrames * mSamplesPerFrame, mSamplesPerSeconds);
is probably the best approach.
Assignee | ||
Comment 5•9 years ago
|
||
* Simplified and factored computation by using FramesToTimeUnit()
* CID 1368390
Attachment #8789757 -
Flags: review?(jyavenard)
Assignee | ||
Updated•9 years ago
|
Attachment #8789752 -
Attachment is obsolete: true
Updated•9 years ago
|
Attachment #8789757 -
Flags: review?(jyavenard) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Component: DOM → Audio/Video: Playback
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9ca5e5bbcf2d
Fix a unit issue in ADTSDemuxer. r=jya
Keywords: checkin-needed
Comment 7•9 years ago
|
||
bugherder |
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Updated•9 years ago
|
Assignee: nobody → paul.bignier
Updated•7 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•